﻿using Abp.NHibernate.EntityMappings;
using Abp.Application.Features;
using Akso.Authorization.Users;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using FluentNHibernate.Mapping;

namespace Akso.NHibernate.EntityMappings
{
    /// <summary>
    /// Define mapping between <see cref="Feature"/> entity and "AbpFeatures" table using FluentNHibernate.
    /// 
    /// Inherits from <see cref="EntityMap{TEntity,TPrimaryKey}"/>.
    /// EntityMap gets table name in it's constructor and automatically maps Id property. So, we do not map Id again.
    /// </summary>
    public class FeatureMap : ClassMap<Feature>
    {
        public FeatureMap()
        {
            Table("dbo.AbpFeatures");
            //Id(x => x.Id);
            Map(x => x.Attributes);
            Map(x => x.Children);
            Map(x => x.DefaultValue);
            Map(x => x.Description);
            Map(x => x.DisplayName);
            Map(x => x.InputType);
            Map(x => x.Name);
            Map(x => x.Parent);
            Map(x => x.Scope);
            //References(x => x.AssignedPerson).Column("AssignedPersonId").LazyLoad();
        }
    }
}
